/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cafeinebeverage;

/**
 *
 * @author skipy
 */
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


public abstract class CaffeineBeverageWithHook {
    final void prepareRecipe()
    {
    boilWater();
    brew();
    pourInCup();
    if(costumerWantsCondiments()){
    addCondiments();    }
    }
    abstract void brew();
    abstract void addCondiments();
    void boilWater()
    {
    System.out.println("Se fierbe apa!");
    }
    void pourInCup()
    {
    System.out.println("Se goleste in cana!");
    }

    private boolean costumerWantsCondiments() {
        return true;
    }
}

